<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">

<h:head>
	<title> Film </title>
	<link rel="stylesheet" type="text/css" href="${facesContext.externalContext.requestContextPath}/resource/css/Style.css" /> 
  
</h:head>
<h:body>
<ui:include src="entete.xhtml" />
		
	<h:form>
	 	<p:toolbar>
        	<f:facet name="left">
            	<p:button type="button" value="Nouveau" outcome="/securite/AjouterFilm" rendered="#{beanConnexion.gestion}" />
 			</f:facet>
		</p:toolbar>
	</h:form>
	<h:form>
   	<p:dataGrid var="film" value="#{beansFilm.films}" columns="3" layout="grid"
        rows="12" paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
         >
          <center>      
        <p:panel header="#{film.titre}" style="text-align:center ; width:335px ; height:335px" >
           
            <h:panelGrid columns="1" >      	
                <h:commandLink disabled="#{beansFilm.valide}" action="/securite/AffichageFilm.xhtml"   styleClass="text" >
			 		<f:setPropertyActionListener value="#{film}" target="#{beansFilm.film}" />
                	<p:graphicImage value="#{film.lien_photo}" /> 
 				</h:commandLink>
                <h:outputLabel value="#{film.annee_sortie}" >
                	<f:convertDateTime type="date" pattern="dd/MM/yyyy" />
                </h:outputLabel>
				
            </h:panelGrid>
            
        </p:panel>
        
        </center>
   	</p:dataGrid>
   	</h:form>	
	
<ui:include src="Pied.xhtml"/>
</h:body>
</html>